@*
    生成者：未登录用户
    生成时间：2021/5/28 15:37:29
    代码由代码生成器自动生成，更改的代码可能被进行替换
    界面如需更改，建议拷贝至自己的工作目录下进行修改
*@
@page "/Role/Add"
@page "/Role/Update"
@using Caviar.Models
@inherits DataComponentBase<ViewRole>
@namespace Caviar.AntDesignPages.Pages.Role

<Form @ref="_meunForm" Model="@DataSource" OnFinish="FormSubmit">
    <FormItem Label='角色名称'>
        <Input @bind-Value='@context.RoleName' Style='width:50%' />
    </FormItem>
    <FormItem Label="父角色">
        <Dropdown>
            <Overlay>
                <Tree ShowIcon DataSource="ViewRoles"
                      TitleExpression="x => x.DataItem.RoleName"
                      ChildrenExpression="x => x.DataItem.Children"
                      IsLeafExpression="x => x.DataItem.Children?.Count == 0"
                      KeyExpression="x => x.DataItem.Id.ToString()"
                      OnClick='e=>EventRecord(e)'
                      TItem="ViewRole">
                </Tree>
            </Overlay>
            <ChildContent>
                <Button OnClick="RemoveRecord">@ParentName</Button>
            </ChildContent>
        </Dropdown>
    </FormItem>
    <FormItem Label='数据权限'>
        <CavUserGroup DataSource="ViewUserGroups"
                      UserGroupName="@UserGroupName"
                      OnSelect="OnUserGroupSelect"
                      OnCancel="OnUserGroupCancel">
        </CavUserGroup>
    </FormItem>
    <FormItem Label='是否禁用'>
        <Switch @bind-Value='@context.IsDisable' />
    </FormItem>
    <FormItem Label='备注'>
        <TextArea @bind-Value='@context.Remark' Style='width:53%' />
    </FormItem>
    <FormItem Label='编号'>
        <Input @bind-Value='@context.Number' Style='width:53%' />
    </FormItem>
</Form>